//index.js
//获取应用实例
const app = getApp()
import { request } from "../../request/request"

Page({
  data: {
    swiperDataList: [],
    cartDataList: [],
    floordataList: []
  },
  onLoad: function () {
    this.getSwiperDataList();
    this.getCartDataList();
    this.getFloordataList();
  },

  // 轮播图
  getSwiperDataList() {
    request({ url: "/home/swiperdata" }).then(res => {
      this.setData({
        swiperDataList: res.data.message
      })
    })
  },

  // 导航
  getCartDataList() {
    request({ url: "/home/catitems" }).then(res => {
      this.setData({
        cartDataList: res.data.message
      })
    })
  },

  // 楼层
  getFloordataList() {
    request({ url: "/home/floordata" }).then(res => {
      this.setData({
        floordataList: res.data.message
      })
    })
  }
})
